<?php
class Cltranscoding{
    public function __construct(){}
	public function __destruct(){}	
	public static function iconv($source,$des='',$string){
 
	     $encode = mb_detect_encoding($string, 
		 array('ASCII','UTF-8','GB2312','GBK','BIG5')); 
		 
		 if ($encode == "EUC-CN"){
			if(in_array(
			$source,array('GB2312','GBK'),false))
			{
				if(!$des){
					$des="UTF-8";
				}
					
		    $string = iconv($source,$des,$string);
			return $string;
		    }
		 }else{
		 
		 $string = iconv($source,$des,$string);
		 }
		 return $string;
		
	}
	
}
?>